<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
</body>
<script type="text/javascript">
    let obj = {};
    let suc = Reflect.defineProperty(obj,"name",{value:"lisi"});
    console.log(suc,obj.name);

    function* f() {
        for(var i = 0; true; i++) {
            var reset = yield i;
            if(reset) { i = -1; }
        }
    }

    var g = f();
    g.next() // { value: 0, done: false }
    g.next() // { value: 1, done: false }
    g.next(true)

    function *feibo(){
        let [prev,curr] = [1,0];
        for (;;) {
            yield curr;
            [prev,curr] = [curr,curr+prev]
        }
    }
    for(let n of feibo()){
        if(n>1000)break;
        console.log(n)
    }
</script>
</html>